const mongoose = require('mongoose')

const schema = new mongoose.Schema({
    goods_list: [{ 
        id: { type: mongoose.SchemaTypes.ObjectId, ref: 'Goodslist' },
        value: Number
    }],
    total_price: { type: String },
    address: [{ 
        name: { type: String },
      phone: { type: String },
      local: { type: String }
    }],
    order_time: { type: Date },
    payment_time: { type: Date },
    out_trade_no:{type:String},
    time_end:{type:String},
    bank_type:{type:String},
    cash_fee:{type: String},
    beizhu:{type: String},
    way:{type: String},
    status: { type: String ,default: "待支付"},
    a_status: { type: String ,default: "待接单"},
})

module.exports = mongoose.model('Order', schema)